import { createRouter, createWebHistory } from 'vue-router'


import Login from '@/views/Login'
import Index from '@/views/index'

import PanZi from '@/views/info/PanZi'
import WangPang from '@/views/info/WangPang'
import XiaoGe from '@/views/info/XiaoGe'
import ANing from '@/views/info/ANing'

import Home  from '@/views/setting/home'

import HelloWorld from '@/views/HelloWorld'

const routes = [
  {
    path: '/',
    redirect: "login",
    hidden: true,
    meta:{
      name: "首页"
    }
  },

  {
     // 默认加载加载的路由---登录页
    path: '/login',
    name: 'Login',
    hidden: true,
    meta:{
      name:"登录"
    },
    component: Login
  },
  {
    path: '/index',
    name: 'Index',
    icon: 'el-icon-menu',
    meta:{
      name: "控制台"
    },
    redirect: "index",
    component: Index,
    children: [
      {
        path: '/index',
        name: 'Index',
        meta: {
          name: "首页"
        },
        component: Home
      }
    ]
  },
  {
    path: '/info',
    name: 'info',
    icon: 'el-icon-document',
    meta: {
      name: "人员管理"
    },
    component: Index,
    children: [
      {
        path: '/xiaoge',
        name: 'XiaoGe',
        meta: {
          name: "张起灵"
        },
        component: XiaoGe
      },
      {
        path: '/WangPang',
        name: 'WangPang',
        meta: {
          name: "王胖子"
        },
        component: WangPang
      },
      {
        path: '/PanZi',
        name: 'PanZi',
        meta: {
          name: "潘子"
        },
        component: PanZi
      },
      {
        path: '/ANing',
        name: 'ANing',
        meta: {
          name: "阿宁"
        },
        component: ANing
      }
      
    ]
  },
  {
    path: '/',
    name: '',
    icon: 'el-icon-setting',
    meta: {
      name: "设置"
    },
    component: Index,
    children: [
      {
        path: '/HelloWorld',
        name: 'HelloWorld',
        meta: {
          name: "你好"
        },
        component: HelloWorld
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
